package com.team.arms.political.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.team.arms.political.domain.PoliReviewInfo;
import com.team.arms.political.domain.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Entity com.ruoyi.political.domain.PoliReviewInfo
 */
public interface PoliReviewInfoMapper extends BaseMapper<PoliReviewInfo> {
    @Update({"update z_poli_review_info set paper_status='已回收' where poli_info_id = #{poliInfoId} "})
    Boolean updatemsgById(@Param("poliInfoId") String poliInfoId);


    List<Polivo> selectpltc();

    @Select(" SELECT e.poli_info_id,a.name,a.bingyi_place,a.id_card,a.age,b.culture_standard,e.police_station_officer,e.armed_forces_officer,e.poli_careful_state" +
            " from b_bingyi_info AS a,b_culture_info as b, z_poli_review_info AS e where a.cultureral_id=b.culture_id  and a.bingyi_info_id=e.bingyi_info_id " +
            " and e.poli_careful_state=#{poliCarefulState}")
    List<Policenvo> selectall(@Param("poliCarefulState") String poliCarefulState);

    @Select(" SELECT e.poli_info_id,a.name,a.age,a.bingyi_place,a.id_card,b.culture_standard,e.police_station_officer,e.armed_forces_officer,e.poli_careful_state from" +
            " b_bingyi_info AS a,b_culture_info as b, z_poli_review_info AS e where a.cultureral_id=b.culture_id  and a.bingyi_info_id=e.bingyi_info_id "+
              "and a.name like \"%${name}%\" and e.poli_careful_state=#{poliCarefulState}"  )
    List<Policenvo> selectpolicenvo(
            @Param("name") String name,@Param("poliCarefulState") String poliCarefulState
    );
    @Select (" SELECT a.name,a.age,a.id_card,b.culture_standard,e.poli_check_results,d.bingyi_place,e.location" +
            " from b_bingyi_info AS a,b_culture_info as b,b_bingyi_regist_info as d, z_poli_review_info AS e where a.cultureral_id=b.culture_id  and a.bingyi_info_id=e.bingyi_info_id and a.bingyi_info_id=d.bingyi_info_id "+
            "and a.name like \"%${name}%\"and e.poli_check_results=\"政审通过\"")
    List<Polialrvo> selectpolialrvo(
            @Param("name") String name
    );
   @Select (" SELECT e.poli_info_id,a.name,a.age,a.id_card,b.culture_standard,e.poli_check_results,d.bingyi_place,e.location" +
            " from b_bingyi_info AS a,b_culture_info as b,b_bingyi_regist_info as d, z_poli_review_info AS e where a.cultureral_id=b.culture_id  and a.bingyi_info_id=e.bingyi_info_id and a.bingyi_info_id=d.bingyi_info_id " +
           " and e.poli_check_results=\"政审通过\"")
    List<Polialrvo>  selectalready();

    @Select (" SELECT a.name,a.age,a.id_card,b.culture_standard,d.bingyi_place,e.paper_status,e.poli_info_id" +
            " from b_bingyi_info AS a,b_culture_info as b,b_bingyi_regist_info as d, z_poli_review_info AS e where a.cultureral_id=b.culture_id  and a.bingyi_info_id=e.bingyi_info_id and a.bingyi_info_id=d.bingyi_info_id " +
            " and e.paper_status =#{paperStatus}")
    List<Messagevo> selectmsg(@Param("paperStatus") String paperStatus);

    @Select (" SELECT a.name,a.age,a.id_card,b.culture_standard,d.bingyi_place,e.paper_status,e.poli_info_id" +
            " from b_bingyi_info AS a,b_culture_info as b,b_bingyi_regist_info as d, z_poli_review_info AS e where a.cultureral_id=b.culture_id  and a.bingyi_info_id=e.bingyi_info_id and a.bingyi_info_id=d.bingyi_info_id " +
            " and e.paper_status =#{paperStatus} and a.name like \"%${name}%\"")
    List<Messagevo> selectmsgbyname(@Param("paperStatus") String paperStatus
                                        , @Param("name") String name);
    List<Polivo> listByType(
            @Param("sex") String sex,
            @Param("batch") String   batch,
            @Param("householdType") String householdType,
            @Param("schoolName")String schoolName,
            @Param("culture_program")String culture_program,
            @Param("bingyiPlace")      String bingyiPlace


            );
   public   Polivo insertpol(Polivo polivo);
    List<Polivo> selectpltcbyid( @Param("id") String   id);
    List<Culvo> selectcul();
    List<Culvo> listbycul(
            @Param("name") String name,
            @Param("id_card") String   id_card,
            @Param("year")String year,
            @Param("batch")      String batch,
            @Param("poli_careful_state")      String poli_careful_state
    );
    List<Polivo> selectbyname(
            @Param("name") String name
    );

}




